using System;
using System.Windows.Forms;

namespace Blader.UI.TextBox
{
    /// <summary>
    /// Summary description for TextLengthTrigger.
    /// </summary>
    [Serializable]
    public class ShortCutTrigger : AutoCompleteTrigger
    {
        private TriggerState result = TriggerState.None;
        private Keys shortCut = Keys.None;

        public ShortCutTrigger()
        {
        }

        public ShortCutTrigger(Keys shortCutKeys, TriggerState resultState)
        {
            shortCut = shortCutKeys;
            result = resultState;
        }

        public Keys ShortCut
        {
            get { return shortCut; }
            set { shortCut = value; }
        }

        public TriggerState ResultState
        {
            get { return result; }
            set { result = value; }
        }

        public override TriggerState OnCommandKey(Keys keyData)
        {
            return keyData == ShortCut ? ResultState : TriggerState.None;
        }
    }
}